import axios from '@/http/axios'
export default{
    namespaced:true,
    state:{
        waiterData:[],
        findWaiter:[]
    },
    getters:{},
    mutations:{
        setWaiterData(state,data){
            state.waiterData=data
        },
        setFindWaiter(state,data){
            state.findWaiter=data
        }
    },
    actions:{
        async toPublishWaiter(context,params){
            return await axios.get('/waiter/auditing?id='+params)
        },
        async toRefuseWaiter(context,params){
            let res = await axios.post('/waiter/refusauditing',params)
        },
        async tofindWaiters(context,params){
            let res = await axios.get('/waiter/findWaiterById?id='+params)
            context.commit('setFindWaiter',res.data.data)
        },
        async toDeleteWaiters(context,params){
            let res = await axios.get('/waiter/deleteById?id='+params)
        },
        async toSaveWaiters(context,params){
            let res = await axios.post('/waiter/saveOrUpdate',params)
        },
        async toLoadWaiters(context,params){
            let res = await axios.post('/waiter/query',params)
            context.commit('setWaiterData',res.data.data)
        }
    }
}